<template>
	<u-modal :show="tips.show" @confirm="tips.confirm" @cancel="tips.cancel" @close="tips.close" :title="tips.title" :showCancelButton="tips.showCancelButton">
		<view class="slot-content">
			<rich-text :nodes="tips.content"></rich-text>
		</view>
	</u-modal>
</template>

<script>
	export default {
		name:"confirm_popup",
		data() {
			return {
				tips: {
					show: false,
					title: '',
					content: '',
					showCancelButton: true,
					confirm: () => {
						this.tipsConfirm();
					},
					cancel: () => {
						this.tipsHide();
					},
					close: () => {
						this.tipsHide();
					},
				},
			};
		},
		methods: {
			tipsShow(content, title = '', confirm = () => {}) {
				this.tips.show = true;
				this.tips.title = title;
				this.tips.content = content;
				this.tipsConfirm = confirm;
			},
			tipsHide() {
				this.tips.show = false;
			},
			tipsConfirm() {},
		},
	};
</script>

<style lang="scss"></style>
